﻿@namespace Microsoft.AspNetCore.Components
@inherits ComponentBase
@typeparam Obj

@{
    var count = Items.Count();
}
<div style="display:grid;grid-template-columns:repeat(@(count*2-1),auto) 1fr;gap:1ch" @attributes="InputAttributes">
    @foreach (var (item, index, _) in Items.PackIndex())
    {
        <div>
            @ItemTemplate(item)
        </div>
        @if (index < count - 1)
        {
            <div>
                @DelimiterTemplate
            </div>
        }
    }
    <div />
</div>